#version 330

uniform mat4 u_Model;
uniform mat4 u_View;
uniform mat4 u_Persp;
uniform mat4 u_InvTrans;

in  vec3 Position;
in  vec3 Normal;
in  vec2 Texcoord;

out vec3 fs_Incident;
out vec3 fs_Normal;
out vec2 fs_Texcoord;
out vec3 fs_Viewer;

void main(void)
{
	fs_Normal = (u_InvTrans*vec4(Normal,0.0f)).xyz;
    fs_Texcoord = Texcoord;
	vec4 world = u_Model * vec4(Position, 1.0);
    vec4 camera = u_View * world;
    fs_Viewer = normalize(-camera.xyz);
	gl_Position = u_Persp * camera;
}
